package org.joinme.backend.mapper;

import org.apache.ibatis.annotations.Param;
import org.joinme.backend.model.ParticipateRecord;
import org.joinme.backend.model.WechatUser;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Repository
@Transactional
public interface ParticipateRecordMapper {

    ParticipateRecord selectByPrimaryKey(@Param("userId") int userId, @Param("carPoolingId") int carPoolingId);

    List<ParticipateRecord> selectByUserId(@Param("userId") int userId, @Param("start") int start, @Param("limit") int limit);

    int deleteByPrimaryKey(@Param("userId") int userId, @Param("carPoolingId") int carPoolingId);

    int insert(ParticipateRecord record);

    int insertSelective(ParticipateRecord record);

    int updateByPrimaryKeySelective(ParticipateRecord record);

    int updateByPrimaryKey(ParticipateRecord record);

    int updateStatus(@Param("userId") int userId, @Param("carPoolingId") int carPoolingId, @Param("participateStatus") int participateStatus);

    int updateRole(@Param("userId") int userId, @Param("carPoolingId") int carPoolingId, @Param("participateRole") int participateRole);

    int updateAllRelatedStatus(@Param("carPoolingId") int carPoolingId, @Param("participateStatus") int participateStatus);
}
